package com.chen.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * @author personcoder007
 * @since 2022-07-17
 */
@Getter
@Setter
@ApiModel(value = "User对象", description = "")
@TableName("user")
public class User extends Model<User> implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("昵称")
    private String nickname;

    @ApiModelProperty("年龄")
    private Integer age;

    @ApiModelProperty("家庭住址")
    private String address;

    @ApiModelProperty("性别")
    private String sex;

//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty("出生日期")
    private Date birthday;

    @ApiModelProperty("角色")
    private String role;

    @ApiModelProperty("积分")
    private String points;

    @ApiModelProperty("头像")
    private String avatar;

    @TableField(exist = false)
    private List<Menu> menus;

    @TableField(exist = false)
    private String token;

    @TableField(exist = false)
    private String code;

    @TableField("open_id")
    private String openId;

}
